/**
 * 
 */
package kulstats;

import java.util.Date;
import java.util.List;

import com.google.appengine.api.datastore.Key;

/**
 * @author steven
 *
 */
public class Study extends Activity implements getCourseable {
	private Course course;
	private int paused;
	private int pauses;
	private Date lastPauseDate;
	
	/**
	 * 
	 */
	public Study(Key key, Date startDate, Date stopDate, int points,
			List<Question> questionnaire, Course course, int paused,int pauses, Date lastPauseDate) {
		super(key, startDate, stopDate, points, questionnaire);
		// TODO Auto-generated constructor stub
		this.paused = paused;
		this.course = course;
		this.pauses = pauses;
		this.lastPauseDate = lastPauseDate;
	}
	public Study(Date startDate, Date stopDate, int points,
			List<Question> questionnaire, Course course, int paused,int pauses, Date lastPauseDate) {
		super(startDate, stopDate, points, questionnaire);
		// TODO Auto-generated constructor stub
		this.paused = paused;
		this.course = course;
		this.pauses = pauses;
		this.lastPauseDate = lastPauseDate;
	}
	
	public int getStudied() {
		return (int) (stopDate.getTime() - startDate.getTime()) / 60000 - getPaused();
	}

	/**
	 * @return the course
	 */
	public Course getCourse() {
		return course;
	}

	/**
	 * @param course the course to set
	 */
	public void setCourse(Course course) {
		this.course = course;
	}

	/**
	 * @return the pauses amount of pauses
	 */
	public int getPauses() {
		return pauses;
	}
	public int getPaused() {
		return paused;
	}

	/**
	 * @param pauses the pauses to set
	 */
	public void setPauses(int pauses) {
		this.pauses = pauses;
	}

	/**
	 * @param paused the pauses to set
	 */
	public void setPaused(int paused) {
		this.paused = paused;
	}
	
	@Override
	public ActivityType getAType()
	{
		return ActivityType.STUDY;
	}
	/**
	 * @return the lastPauseDate
	 */
	public Date getLastPauseDate() {
		return lastPauseDate;
	}
	/**
	 * @param lastPauseDate the lastPauseDate to set
	 */
	public void setLastPauseDate(Date lastPauseDate) {
		this.lastPauseDate = lastPauseDate;
	}
}
